package chapter07

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/7 22:23
  * @history:
  *          1.2019/1/7 created by chuhaitao
  */
object OOPDemo {
  def main(args: Array[String]): Unit = {

    var employee = new Employee

    employee.printName("12")

  }
}


class Person {

  def printName(name: String): Unit = {
    println("121")
  }

}

class Employee extends Person {
  //必须明确的声明override
  override def printName(name: String): Unit = {
    super.printName("12")
  }
}
